package com.tigercel.xiangchengyun.ui.activities

import android.content.Intent
import android.os.Bundle
import android.os.Handler
import android.support.v7.app.AppCompatActivity
import com.tigercel.xiangchengyun.App
import com.tigercel.xiangchengyun.R


class StartActivity : AppCompatActivity() {
    companion object {
        const val SPLASH_DISPLAY_LENGHT : Long = 2000
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_start)

        Handler().postDelayed({
            val isFirstIn = App.getInstance().isFristStart
            if (isFirstIn) {//第一次启动app，显示引导页
                startActivity(Intent(this, GuideActivity::class.java))
            } else {
                startActivity(Intent(this, MainActivity::class.java))
            }

           finish()
        }, SPLASH_DISPLAY_LENGHT)
    }
}
